import Vue from 'vue'
import App from './App.vue'

//引入全局组件
import TypeNav from './components/TypeNav'
import Carousel from './components/Carousel'
import Pagination from './components/Pagination'
//注册全局组件
Vue.component(TypeNav.name,TypeNav)
Vue.component(Carousel.name,Carousel)
Vue.component(Pagination.name,Pagination)

//引入路由
import router from './router/index.js'

//引入仓库
import store from './store'

//引入mockServe.js
import './mock/mockServe.js'

//引入轮播样式
import 'swiper/css/swiper.css'

//统一接口文件的所有函数
import * as API from './api'


//引入饿了么ui组件库
import { Button, MessageBox } from 'element-ui'

Vue.component(Button.name, Button);

Vue.prototype.$msgbox = MessageBox;
Vue.prototype.$alert = MessageBox.alert;



Vue.config.productionTip = false

new Vue({
  render: h => h(App),
  //注册路由
  router,
  //注册store
  store,
  beforeCreate() {
	  //全局事件总线
  	Vue.prototype.$bus = this
	//将所有的api添加到vue的原型上
	Vue.prototype.$API =API 
  }
}).$mount('#app')
